{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "sys.path.append('..')\n",
    "\n",
    "from utils import load_obj"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from llm_vllm_data import industry_infos"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# from OnlineLLM.core import send_req\n",
    "# from OnlineLLM.urls import urls"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "from OnlineLLM import wenxin"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "res = []\n",
    "for item in industry_infos[506:]:\n",
    "    answer = wenxin.send_req(item)\n",
    "    res.append(answer)\n",
    "    break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'id': 'as-pxpe091j7x',\n",
       "  'object': 'chat.completion',\n",
       "  'created': 1717255323,\n",
       "  'result': \"要完成这个任务，我们首先要分析文本的主要内容。文本主要描述了中能氢储（内蒙古）生物能源科技集团有限公司的经营范围，其中涉及了植物种植、生物质能源开发、氢能源储存材料和设备的研发、工程和技术研究等多个方面。虽然文本中提到了氢能源储存材料和设备的研发，但这只是其经营范围的一部分，并未明确指出其主要业务是集中在氢能领域的某个特定类别上。\\n\\n然后，需要从给定的标签集合中选择最符合文本主题的标签。在本例中，给定的标签集合包括化石燃料制氢、工业副产氢、电解水制氢、压缩气态储氢、低温液态储氢、液氨/甲醇储氢、氢化物/LOHC、加氢站、氢燃料电池汽车、绿色航运、可持续航煤、绿氢耦合化工、氢能炼化行业、氢冶金、氢气发电、建筑领域等。根据文本内容，无法明确判断其最符合哪个标签，因为文本中的描述涉及了氢能领域的多个方面，但没有明显偏向于任何一个特定类别。\\n\\n因此，根据文本内容，无法从给定的标签集合中找到一个最符合的标签。所以答案是['其他']。\",\n",
       "  'is_truncated': False,\n",
       "  'need_clear_history': False,\n",
       "  'finish_reason': 'normal',\n",
       "  'usage': {'prompt_tokens': 568,\n",
       "   'completion_tokens': 229,\n",
       "   'total_tokens': 797}}]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "json.load"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "llm",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
